<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>修改密码 - 学生意见管理系统</title>
    <!-- 引入网站头部 -->
    <div th:replace="~{include/all_include::title}"/>
    <link rel="stylesheet" th:href="@{/common/resource/bootstrapvalidator/css/form-validation.css}">
    <script type="text/javascript" th:src="@{/common/resource/bootstrapvalidator/js/form-validation.js}"></script>
    <script type="text/javascript">
        $(function()
        {
            $("#form").FormValidation({
                fields:
                    {
                        /* 原密码 */
                        souPass:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '原密码不能为空'
                                    },
                                    stringLength: {
                                        min: 4,
                                        max:40,
                                        message: '原密码的长度为在4位与40位之间'
                                    }
                                }
                            },
                        /* 密码 */
                        password:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '密码不能为空'
                                    },
                                    stringLength: {
                                        min: 4,
                                        max:40,
                                        message: '密码的长度为在4位与40位之间'
                                    },
                                    equalsTo :
                                        {
                                            /* 比较密码的id */
                                            name:"confirmPass",
                                            message: '两次密码输入不一样'
                                        }
                                }
                            },
                        /* 确认密码 */
                        confirmPass:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '密码不能为空'
                                    },
                                    stringLength: {
                                        min: 4,
                                        max:40,
                                        message: '密码的长度为在4位与40位之间'
                                    },
                                    equalsTo :
                                        {
                                            /* 比较密码的id */
                                            name:"password",
                                            message: '两次密码输入不一样'
                                        }
                                }
                            },
                    }
            });
        });
    </script>
</head>
<body>
<div th:replace="~{include/all_include::header}"/>
<!-- 网页的主体 -->
<div class="container">
    <div class="col-md-8 col-sm-10">
        <form id="form" method="post" class="form-horizontal" th:action="@{/head/users/usersUpdateSubmit}">
            <input type="hidden" name="operType" th:value="${param.operType}">
            <h2  class="col-sm-10 col-sm-offset-1 form-signin-heading text-center">修改密码</h2>
            <div class="form-group">
                <label for="email" class="col-sm-3 control-label">邮箱</label>
                <div class="col-sm-5" th:text="${session.users.email }">
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">原密码</label>
                <div class="col-sm-8">
                    <input type="password" name="souPass" id="souPass"
                           class="form-control" placeholder="原密码" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">密码</label>
                <div class="col-sm-8">
                    <input type="password" name="password" id="password"
                           class="form-control" placeholder="密码" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">确认密码</label>
                <div class="col-sm-8">
                    <input type="password" name="confirmPass" id="confirmPass"
                           class="form-control" placeholder="确认密码" />
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-2">
                    <button class="btn btn-md btn-primary" type="submit">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div th:replace="~{include/all_include::footer}"/>
</body>
</html>